#include "app_test.h"
#include "app_procotol.h"
#include "app_procotol_sendcmd.h"
#include "bsp_io_driver.h"
#include "bsp_adccollect.h"
void app_test_compare(unsigned char *pt,unsigned int len)
{
    unsigned char ret = 0;
    unsigned char iomp;
    unsigned int short adread,adget;
    adget = pt[0] << 8;
    adget |= pt[1];

    adread = bsp_adcollect_getvalue(0);

    if(adread  >=  adget)
    {
	    iomp = BSP_IO_GetIoValue(MAPAN);
	    if(iomp == pt[12])
	    {
	         iomp = BSP_IO_GetIoValue(IR1OUT);
	         if(iomp == pt[13])
	         {
	                iomp = BSP_IO_GetIoValue(IR2OUT);
		         if(iomp == pt[14])
		         {
		                iomp = BSP_IO_GetIoValue(CIOOUT);
			         if(iomp == pt[15])
			         {
			              ret = 1;
			         }
		         }
	         }
	    }
    }
    
    
    proctol_send_testResult(ret);
}
